<%-- 
    Document   : index
    Created on : Jan 16, 2012, 5:32:48 PM
    Author     : LuisCarvajal
--%>
<%@page import="java.util.*" session="true" %>
<%@page import="logica.ControlPersona"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Servidor Central</title>
        <style type="text/css">
            body
            {
                margin: 0px;
            }
            #tope
            {
                background-color: #029dd5;
                width: 100%;
                height: 10px;
            }
            #Titulo
            {
                margin-top: 30px;
                margin-left: 30px;
            }
            #TituloClinica
            {
                font-size: 30pt;
                font-weight: 600;
                color: #238bb0;
                text-decoration: underline;
                margin-left: 10px;
                position: relative;
                top: -10px;
                
            }
            #footer
            {
                position: absolute;
                bottom: 1px;
                background-image: url('IMG/footer.png');
                background-repeat: repeat-x;
                background-color: #029dd5;
                background-position: top;
                width: 100%;
                height: 65px;
            }
            #Consultar
            {
                background-image: url('IMG/Consultar.png');
                margin-left: 800px;
                margin-top: -50px;
                width: 500px;
                height: 140px;
                cursor: pointer;
            }
            #Consultar:hover
            {
                background-image: url('IMG/Consultar2.png');
            }
            #Agregar
            {
                background-image: url('IMG/Agregar.png');
                margin-left: 700px;
                width: 500px;
                height: 140px;
                cursor: pointer;
            }
            #Agregar:hover
            {
                background-image: url('IMG/Agregar2.png');
            }
            #Reportes
            {
                background-image: url('IMG/Reportes.png');
                margin-left: 600px;
                margin-top: 40px;
                width: 500px;
                height: 140px;
                cursor: pointer;
            }
            #Reportes:hover
            {
                background-image: url('IMG/Reportes2.png');
            }
            #actualizar
            {
                font-size: 20pt;
                font-weight: 300;
                color: #238bb0;
                text-decoration: none;
                margin-left: 40px;
                position: absolute;
                bottom: 90px; 
            }
            
        </style>
    </head>
    <body>
        <div id="tope"></div>
        <div id="Titulo"><img src="IMG/Icon.png" width="50" height="50" lang="Clinica"/><span id="TituloClinica">Clínicas Unidas de Venezuela</span></div>
        <% 
            HttpSession sesion = request.getSession();
            String aux = (String) sesion.getAttribute("Estado");
            
            ControlPersona MiControl = new ControlPersona();
            if(aux.equals("Off")){
            if(MiControl.ValidarPersona(request.getParameter("Nombre"), request.getParameter("Pass")) == true){
                sesion.setAttribute("Estado", "On");
                out.println("<div id='Consultar' onclick='location.href=\"Consultar.jsp\";' ></div>");
                out.println("<div id='Agregar' onclick='location.href=\"Agregar.jsp\";'></div>");
                out.println("<div id='Reportes' onclick='location.href=\"Reportes.jsp\";'></div>");
                out.println("<form action=\"Respaldo.jsp\" method=\"post\" id=\"actualizar\">");
                out.println("<p style=\"text-decoration: underline;\" >Actualizar del Respaldo</p>");
                out.println("<label for=\"IP\">Ip del Respaldo:</label><input type=\"text\" id=\"IP\" name=\"IP\"/>");
                out.println("<input type=\"submit\" value=\"Actualizar\" id=\"BotonSubmit\">");
                out.println("</form>");
            }else{
                out.println("Nombre de usuario o contraseña erroneo.");
            }
                       }else{
                out.println("<div id='Consultar' onclick='location.href=\"Consultar.jsp\";' ></div>");
                out.println("<div id='Agregar' onclick='location.href=\"Agregar.jsp\";'></div>");
                out.println("<div id='Reportes' onclick='location.href=\"Reportes.jsp\";'></div>");
                out.println("<form action=\"Respaldo.jsp\" method=\"post\" id=\"actualizar\">");
                out.println("<p style=\"text-decoration: underline;\" >Funciones de Respaldo</p>");
                out.println("<input type=\"submit\" value=\"Cargar\" id=\"BotonSubmit\">");
                out.println("<input type=\"button\" value=\"Guardar\" id=\"BotonSubmit\" onclick='location.href=\"Guardar.jsp\";'>");
                out.println("</form>");
            }
                      
            




        %>
        <div id="footer"></div>
    </body>
</html>
